const path = require('path');

module.exports = {
    target: 'node',
    entry: {
        extension: './src/extension.ts',
        debugger: './src/debugger/debugger.ts'
    },
    output: {
        path: path.resolve(__dirname, 'extension/out'),
        filename: '[name].js',
        libraryTarget: 'commonjs2',
        devtoolModuleFilenameTemplate: '../[resource-path]'
    },
    devtool: 'source-map',
    externals: {
        vscode: 'commonjs vscode',
        'vscode-debugadapter': 'commonjs vscode-debugadapter',
        'vscode-debugprotocol': 'commonjs vscode-debugprotocol'
    },
    resolve: {
        extensions: ['.ts', '.js']
    },
    module: {
        rules: [{
            test: /\.ts$/,
            exclude: /node_modules/,
            use: [{
                loader: 'ts-loader',
                options: {
                    compilerOptions: {
                        "module": "commonjs"
                    }
                }
            }]
        }]
    }
};